package com.coment.po;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;

import java.util.Objects;

/// 玩家道具

@NoArgsConstructor
public class UserProp {

    @JsonIgnore
    @Id
    public Integer id;

    @Indexed
    public Integer userInfoId;

    @Indexed
    public Integer propId;

    /// 道具数量
    public Integer number;

    /// 使用 次数
    public int useCount;


    public UserProp(Integer userInfoId, Integer propId) {
        this.userInfoId = userInfoId;
        this.propId = propId;
        this.id = Objects.hash(userInfoId, propId);
        this.number = 0;
    }


}
